char *addBinary(char *a, char *b)
{
    if (a == "0" || b == "0")
        return a == "0" ? b : a;
    int alenth = strlen(a), blenth = strlen(b);
    char *big = alenth >= blenth ? a : b;
    char *small = alenth < blenth ? a : b;
    int ret = 0;
    int biglen = strlen(big), smalllen = strlen(small);
    char *ans = malloc(sizeof(char) * (biglen + 2));
    ans[biglen + 1] = '\0';
    for (int i = smalllen - 1, j = biglen - 1, pos = biglen; j >= 0; i--, j--, pos--)
    {
        if (i >= 0)
        {
            // printf("%c%c ",small[i],big[j]);
            ans[pos] = small[i] + big[j] - '0' + ret;
            if (ans[pos] >= '2')
                ans[pos] -= 2, ret = 1;
            else
                ret = 0;
            // printf("%c ",ans[pos]);
        }
        else
        {
            ans[pos] = big[j] + ret;
            if (ans[pos] >= '2')
                ans[pos] -= 2, ret = 1;
            else
                ret = 0;
        }
    }
    if (ret)
    {
        ans[0] = '1';
    }
    else
        ans++;
    return ans;
}